package com.health.db.dao.order.impl;


import java.util.List;

import com.health.db.dao.ServiceInterface;
import com.health.db.dao.order.IZAdviceHotDao;
import com.health.db.mapper.ZAdviceHotMapper;
import com.health.db.model.ZAdviceHotExample;
import com.health.db.model.ZAdviceHotTemp;
import com.health.redis.RedisConstants;


public class ZAdviceHotDaoImpl extends ServiceInterface implements IZAdviceHotDao{

	private ZAdviceHotMapper zAdviceHotMapper;
	@Override
	public List<ZAdviceHotTemp> selectSimple(ZAdviceHotExample example) {
		// TODO Auto-generated method stub
		
		String key=RedisConstants.ZAdviceHotMapper+"";
		List<ZAdviceHotTemp> list=null;
		Object object=null;
		
		if(redisOperatiorLogic.isJedisIsConnected())
		{
			object = redisOperatiorLogic.readObject(key, getOrderRedisGroupNo("1"));
		}
		if(null!=object&&!object.equals("")){
			list =  (List) object;
		}
		else
		{
			list=zAdviceHotMapper.selectSimple(example);

			if(redisOperatiorLogic.isJedisIsConnected())
			{
			redisOperatiorLogic.setEx(key, list, getOrderRedisGroupNo("1"));
			}
		}
		return list;
		
	}
	public ZAdviceHotMapper getzAdviceHotMapper() {
		return zAdviceHotMapper;
	}
	public void setzAdviceHotMapper(ZAdviceHotMapper zAdviceHotMapper) {
		this.zAdviceHotMapper = zAdviceHotMapper;
	}

	
}
